package day01;

/**
 * @author Jetwang
 * @version 1.0
 * @since 2023/2/28 11:03
 */
public class Fibonacci {
    public static void main(String[] args) {
        for (int i = 0; i < 11; i++) {
            // 递归调用次数符合 2 * f(n+1) - 1
            System.out.println(fibonacci(i));
        }
    }


    public static int fibonacci(int n) {
        if (n == 0 || n == 1) {
            return n;
        }
        return fibonacci(n-1) + fibonacci(n-2);
    }
}
